// components/product-card-small/product-card-small.js
Component({
    /**
     * 组件的属性列表
     */
    properties: {
        productInfo: {
            type: Object,
            value: {},
        },
    },

    /**
     * 组件的初始数据
     */
    data: {},

    lifetimes: {},

    /**
     * 组件的方法列表
     */
    methods: {
        /**
         * 点击商品购物车
         */
        onTapShippingCart() {
            const id = this.data.productInfo.id;
            wx.navigateTo({
                url: `/pages/Product/Product?productId=${id}&showShippingCart=true`,
            });
        },
        /**
         * 点击商品
         */
        onTapProduct() {
            const id = this.data.productInfo.id;
            wx.navigateTo({
                url: `/pages/Product/Product?productId=${id}`,
            });
        },
    },
});
